//
//  CommunitySupermarketTableViewCell.m
//  CommunitySupermarketProiect
//
//  Created by 吕惠卿 on 2017/10/17.
//  Copyright © 2017年 吕惠卿. All rights reserved.
//

#import "CommunitySupermarketTableViewCell.h"

@implementation CommunitySupermarketTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self creatUI];
    }
    return self;
}

-(void)creatUI{
    _iconImg = [[UIImageView alloc]init];
    //_iconImg.backgroundColor = [UIColor redColor];
    [self addSubview:_iconImg];
    [_iconImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(8);
        make.top.equalTo(self.mas_top).with.offset(8);
        make.bottom.equalTo(self.mas_bottom).with.offset(-8);
        make.width.mas_equalTo(WIDTH/3);
        
    }];

    _metterLab = [[UILabel alloc]init];//米
    _metterLab.textAlignment = NSTextAlignmentRight;
    _metterLab.textColor = [UIColor grayColor];
    _metterLab.font = [UIFont systemFontOfSize:14.0];
    [self addSubview:_metterLab];
    [_metterLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.mas_top).with.offset(8);
        make.right.equalTo(self.contentView.mas_right).with.offset(-8);
        make.height.mas_offset(25);
        make.width.mas_offset(70);
    }];
    _nameLab = [[UILabel alloc]init];
    _nameLab.font = [UIFont fontWithName:@"Marion" size:16.0];
    _nameLab.numberOfLines = 0;
    [self addSubview:_nameLab];
    [_nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(_metterLab.mas_left).with.offset(-8);
        make.left.equalTo(_iconImg.mas_right).with.offset(8);
        make.top.equalTo(self.contentView.mas_top).with.offset(8);
        make.height.mas_offset(30);
    }];
    _contLab = [[UILabel alloc]init];
    _contLab.numberOfLines = 0;
    _contLab.font = [UIFont systemFontOfSize:14.0];
//    _contLab.backgroundColor = [UIColor redColor];
    _contLab.textColor = [UIColor grayColor];
    [self addSubview:_contLab];
    [_contLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView.mas_right).with.offset(-8);
        make.left.equalTo(_iconImg.mas_right).with.offset(8);
        make.top.equalTo(_nameLab.mas_bottom).with.offset(8);
        make.bottom.equalTo(self.contentView.mas_bottom).with.offset(-8);
    }];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
